package tang.Config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/*
* 声明此类是配置类
* */
@Configuration
public class goodsconfig {

    @LoadBalanced  //加上这个注解,负载均衡Ribbon才能使用
    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }
}
